package com.shuyun.ccms.encrypt;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import com.shuyun.ccms.encrypt.common.SpringContainer;
import com.shuyun.ccms.encrypt.data.EncryptProcessor;
import com.shuyun.ccms.encrypt.data.impl.EncryptCustomerInfoProcessor;
import com.shuyun.ccms.encrypt.data.impl.EncryptCustomerPhoneProcessor;
import com.shuyun.ccms.encrypt.data.impl.EncryptDashboardContactProcessor;
import com.shuyun.ccms.encrypt.data.impl.EncryptOrderInfoProcessor;
import com.shuyun.crypt.CryptTools;

public class EncryptDataProcess {
    private static Logger logger = LoggerFactory.getLogger(EncryptDataProcess.class);
    public static void main(String[] args) throws Exception {
      SpringContainer.init();
    //	ApplicationContext context = SpringContainer.getContext();


    	/*long phoneStart = System.currentTimeMillis();
        EncryptProcessor custNoProcessor = new EncryptCustomerPhoneProcessor();
        custNoProcessor.execute();
        long phoneEnd = System.currentTimeMillis();
        logger.info("=============== 加密 所有租户客户手机号码结束.总耗时: " + (phoneEnd - phoneStart)/1000 + "s");

       	long infoStart = System.currentTimeMillis();
        EncryptProcessor custInfoProcessor = new EncryptCustomerInfoProcessor();
        custInfoProcessor.execute();
    	long infoEnd = System.currentTimeMillis();
        logger.info("===================加密所有租户客户信息结束.总耗时: " + (infoEnd - infoStart)/1000 + "s");

       	long orderStart = System.currentTimeMillis();
        EncryptProcessor orderProcessor = new EncryptOrderInfoProcessor();
        orderProcessor.execute();
       	long orderEnd = System.currentTimeMillis();
        logger.info("===================加密所有租户订单结束.总耗时: " + (orderEnd - orderStart)/1000 + "s");

        System.out.println("恭喜你,加密数据完成。。。。。。");*/

    	/*String name = CryptTools.encrypt("1861634123", CryptTools.TYPE_NICK);
    	System.out.println(name);

    	String phone = CryptTools.decrypt("$136$uljF93CNPDaYJxIXBY7MPg==$1$", CryptTools.TYPE_PHONE);

    	Long a = 10001L;
    	Long b = 10001l;

    	System.out.println( phone);*/
    }

}
